﻿namespace Sidvall.WorkItemManager.Net.Services.V1
{
    public sealed partial class WorkItemCollectionItem : global::Sidvall.Data.ServiceDataRowCollectionItem<global::Sidvall.WorkItemManager.Net.Services.V1.WorkItem>
    {
        #region Public Members

        #region LoadWorkItemLogsAsync

        public async System.Threading.Tasks.Task LoadWorkItemLogsAsync()
        {
            await LoadWorkItemLogsAsync(false, false, null, null, null).ConfigureAwait(false);
        }
        public async System.Threading.Tasks.Task LoadWorkItemLogsAsync(bool refresh, bool raisePropertyChanged, global::Sidvall.Data.FetchListCriteria<global::Sidvall.WorkItemManager.Data.Fields.WorkItemLogField, global::Sidvall.WorkItemManager.Data.Relations.WorkItemLogRelation> criteria, string strategyContext, global::Sidvall.Data.ObjectParameterCollection objectParameters)
        {
            await global::Sidvall.WorkItemManager.SystemContext.Current.DataPortal.WorkItemManager.LoadWorkItemLogsAsync(this.Items, refresh, raisePropertyChanged, criteria, strategyContext, objectParameters).ConfigureAwait(false);
        }

        #endregion
        #region LoadWorkItemSensorsAsync

        public async System.Threading.Tasks.Task LoadWorkItemSensorsAsync()
        {
            await LoadWorkItemSensorsAsync(false, false, null, null, null).ConfigureAwait(false);
        }
        public async System.Threading.Tasks.Task LoadWorkItemSensorsAsync(bool refresh, bool raisePropertyChanged, global::Sidvall.Data.FetchListCriteria<global::Sidvall.WorkItemManager.Data.Fields.WorkItemSensorField, global::Sidvall.WorkItemManager.Data.Relations.WorkItemSensorRelation> criteria, string strategyContext, global::Sidvall.Data.ObjectParameterCollection objectParameters)
        {
            await global::Sidvall.WorkItemManager.SystemContext.Current.DataPortal.WorkItemManager.LoadWorkItemSensorsAsync(this.Items, refresh, raisePropertyChanged, criteria, strategyContext, objectParameters).ConfigureAwait(false);
        }

        #endregion
        #region LoadWorkItemWorkConditionsAsync

        public async System.Threading.Tasks.Task LoadWorkItemWorkConditionsAsync()
        {
            await LoadWorkItemWorkConditionsAsync(false, false, null, null, null).ConfigureAwait(false);
        }
        public async System.Threading.Tasks.Task LoadWorkItemWorkConditionsAsync(bool refresh, bool raisePropertyChanged, global::Sidvall.Data.FetchListCriteria<global::Sidvall.WorkItemManager.Data.Fields.WorkItemWorkConditionField, global::Sidvall.WorkItemManager.Data.Relations.WorkItemWorkConditionRelation> criteria, string strategyContext, global::Sidvall.Data.ObjectParameterCollection objectParameters)
        {
            await global::Sidvall.WorkItemManager.SystemContext.Current.DataPortal.WorkItemManager.LoadWorkItemWorkConditionsAsync(this.Items, refresh, raisePropertyChanged, criteria, strategyContext, objectParameters).ConfigureAwait(false);
        }

        #endregion
        #region LoadWorkersAsync

        public async System.Threading.Tasks.Task LoadWorkersAsync()
        {
            await LoadWorkersAsync(false, false, null, null, null).ConfigureAwait(false);
        }
        public async System.Threading.Tasks.Task LoadWorkersAsync(bool refresh, bool raisePropertyChanged, global::Sidvall.Data.FetchListCriteria<global::Sidvall.WorkItemManager.Data.Fields.WorkerField, global::Sidvall.WorkItemManager.Data.Relations.WorkerRelation> criteria, string strategyContext, global::Sidvall.Data.ObjectParameterCollection objectParameters)
        {
            await global::Sidvall.WorkItemManager.SystemContext.Current.DataPortal.WorkItemManager.LoadWorkersAsync(this.Items, refresh, raisePropertyChanged, criteria, strategyContext, objectParameters).ConfigureAwait(false);
        }

        #endregion
        #region LoadWorkItemTypesAsync

        public async System.Threading.Tasks.Task LoadWorkItemTypesAsync()
        {
            await LoadWorkItemTypesAsync(false, false, null, null, null).ConfigureAwait(false);
        }
        public async System.Threading.Tasks.Task LoadWorkItemTypesAsync(bool refresh, bool raisePropertyChanged, global::Sidvall.Data.FetchListCriteria<global::Sidvall.WorkItemManager.Data.Fields.WorkItemTypeField, global::Sidvall.WorkItemManager.Data.Relations.WorkItemTypeRelation> criteria, string strategyContext, global::Sidvall.Data.ObjectParameterCollection objectParameters)
        {
            await global::Sidvall.WorkItemManager.SystemContext.Current.DataPortal.WorkItemManager.LoadWorkItemTypesAsync(this.Items, refresh, raisePropertyChanged, criteria, strategyContext, objectParameters).ConfigureAwait(false);
        }

        #endregion
        #region LoadWorkRetryPoliciesAsync

        public async System.Threading.Tasks.Task LoadWorkRetryPoliciesAsync()
        {
            await LoadWorkRetryPoliciesAsync(false, false, null, null, null).ConfigureAwait(false);
        }
        public async System.Threading.Tasks.Task LoadWorkRetryPoliciesAsync(bool refresh, bool raisePropertyChanged, global::Sidvall.Data.FetchListCriteria<global::Sidvall.WorkItemManager.Data.Fields.WorkRetryPolicyField, global::Sidvall.WorkItemManager.Data.Relations.WorkRetryPolicyRelation> criteria, string strategyContext, global::Sidvall.Data.ObjectParameterCollection objectParameters)
        {
            await global::Sidvall.WorkItemManager.SystemContext.Current.DataPortal.WorkItemManager.LoadWorkRetryPoliciesAsync(this.Items, refresh, raisePropertyChanged, criteria, strategyContext, objectParameters).ConfigureAwait(false);
        }

        #endregion

        #region Copy

        public WorkItemCollectionItem Copy()
        {
            return global::Sidvall.WorkItemManager.SystemContext.Current.EntityFacade.WorkItemManager.Copy(this.Items);
        }
        public WorkItemCollectionItem Copy(Sidvall.Data.CopySettings settings)
        {
            return global::Sidvall.WorkItemManager.SystemContext.Current.EntityFacade.WorkItemManager.Copy(this.Items, settings);
        }

        #endregion
        #region Import

        public void Import(System.Collections.Generic.IEnumerable<global::Sidvall.WorkItemManager.Data.IWorkItem> items)
        {
            global::Sidvall.WorkItemManager.SystemContext.Current.EntityFacade.WorkItemManager.Import(this.Items, items);
        }
        public void Import(System.Collections.Generic.IEnumerable<global::Sidvall.WorkItemManager.Data.IWorkItem> items, Sidvall.Data.CopySettings settings)
        {
            global::Sidvall.WorkItemManager.SystemContext.Current.EntityFacade.WorkItemManager.Import(this.Items, items, settings);
        }

        #endregion
        #region SaveItemsAsync

        public async System.Threading.Tasks.Task<WorkItemCollectionItem> SaveItemsAsync()
        {
            return await global::Sidvall.WorkItemManager.SystemContext.Current.DataPortal.WorkItemManager.SaveItemsAsync(this).ConfigureAwait(false);
        }
        public async System.Threading.Tasks.Task<WorkItemCollectionItem> SaveItemsAsync(Sidvall.Data.SaveMode mode)
        {
            return await global::Sidvall.WorkItemManager.SystemContext.Current.DataPortal.WorkItemManager.SaveItemsAsync(this, mode).ConfigureAwait(false);
        }
        public async System.Threading.Tasks.Task<WorkItemCollectionItem> SaveItemsAsync(Sidvall.Data.SaveSettings settings)
        {
            return await global::Sidvall.WorkItemManager.SystemContext.Current.DataPortal.WorkItemManager.SaveItemsAsync(this, settings).ConfigureAwait(false);
        }

        #endregion
        #region ValidateAsync

        public async System.Threading.Tasks.Task<Sidvall.Data.BusinessRuleCollection> ValidateAsync()
        {
            return await global::Sidvall.WorkItemManager.SystemContext.Current.EntityFacade.WorkItemManager.ValidateAsync(this.Items).ConfigureAwait(false);
        }
        public async System.Threading.Tasks.Task<Sidvall.Data.BusinessRuleCollection> ValidateAsync(Sidvall.Data.ValidationSettings settings)
        {
            return await global::Sidvall.WorkItemManager.SystemContext.Current.EntityFacade.WorkItemManager.ValidateAsync(this.Items, settings).ConfigureAwait(false);
        }

        #endregion
        #region Initialize

        public void Initialize()
        {
            global::Sidvall.WorkItemManager.SystemContext.Current.EntityFacade.WorkItemManager.Initialize(this.Items);
        }
        public void Initialize(Sidvall.Data.InitializeSettings settings)
        {
            global::Sidvall.WorkItemManager.SystemContext.Current.EntityFacade.WorkItemManager.Initialize(this.Items, settings);
        }

        #endregion

        #endregion
        #region Constructors

        public WorkItemCollectionItem()
        {
        }
        public WorkItemCollectionItem(System.Collections.Generic.IEnumerable<global::Sidvall.WorkItemManager.Net.Services.V1.WorkItem> items)
            : base(items)
        {
        }

        #endregion
    }
}